using UnityEngine;
using System.Collections;

public class Gerenciador 
{
    public Gerenciador()
    {
		GameObject.Find("Cena").GetComponent<Jogo>().StartCoroutine(Instancia());
    }

    public void Update()
    {
    }
	
	IEnumerator Instancia()
	{
		while(true)
		{
			yield return new WaitForSeconds(3.0f);
			
			int r = Random.Range(1, 4);
			
			switch(r)
			{
				case 1:
					GameObject g = new GameObject("Lixeira", typeof(Lixeira));
				break;
				
				case 2:
					GameObject h = new GameObject("Lixo", typeof(Lixo));
				break;
				
				case 3:
					GameObject i = new GameObject("Buraco", typeof(Buraco));
				break;
				
				default:
					GameObject j = new GameObject("Lixeira", typeof(Lixeira));
				break;
			}
		}
	}
}
